package com.yanyeori.springaop.service.impl;

import com.yanyeori.springaop.dao.UserDao;
import com.yanyeori.springaop.entity.User;
import com.yanyeori.springaop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author chenkuan
 * @desc
 * @date 2021/3/10 010 19:03
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    UserDao userDao;

    @Override
    public User select(Integer id) {
        System.out.println("查询User");
        return userDao.select(id);
    }

    @Override
    public void add(User user) {
        System.out.println("新增User");
        userDao.add(user);
    }

    @Override
    public void update(User user) {
        System.out.println("修改User");
        userDao.update(user);
    }

    @Override
    public void delete(Integer id) {
        System.out.println("删除User");
        userDao.delete(id);
    }
}
